package vn.codespot.hms.model.response;

public class ResponseModelFactory {
    private static ResponseModelFactory mFactory;

    private ResponseModelFactory() {
        // Make it single-ton
    }

    public static ResponseModelFactory getIntance() {
        if (mFactory == null) {
            mFactory = new ResponseModelFactory();
        }
        return mFactory;
    }

    public IResponseModel getResponseModel(String api, String json) {
        if (api.endsWith("/visa/apply")) {
            return new ApplyResponseModel(json);
        } else if (api.endsWith("/visa/fees")) {
            return new FeesRepsonseModel(json);
        } else if (api.endsWith("/visa/status")) {
            return new StatusResponseModel(json);
        } else if (api.endsWith("/national")) {
            return new NationalResponseModel(json);
        } else {
            return null;
        }
    }
}
